package httpclient.jfinal.aop;


import com.jfinal.handler.Handler;
import httpclient.sdk.DefaultHttpProxy;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class ProxyHandler extends Handler {
    @Override
    public void handle(String target, HttpServletRequest request, HttpServletResponse response, boolean[] isHandled) {
        if (target.startsWith("/")) {
			new DefaultHttpProxy().execute(request, response);
			return;
        }
        nextHandler.handle(target, request, response, isHandled);
    }
}
